package com.sl.au.repository;
import java.util.List;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import com.sl.au.entity.ReceivedPaymentTotalInfo;

public interface ReceivedPaymentTotalInfoRepository extends JpaRepository<ReceivedPaymentTotalInfo, String> {
	@Query("select c from ReceivedPaymentTotalInfo c where c.sReceivedPaymentsCustomerName=?1")
	List<ReceivedPaymentTotalInfo> findSReceivedPaymentsCustomerName(String CustomerName);	
    
	ReceivedPaymentTotalInfo findBySReceivedPaymentsIdentifyNumber(String sReceivedPaymentsIdentifyNumber);
	
	@Query("select count(*) from ReceivedPaymentTotalInfo c where c.sReceivedPaymentsIdentifyNumber like %?1% or c.sReceivedPaymentsCustomerName like %?1% or c.sReceivedPaymentMemo like %?1% ")
	long getCount(String key);
	@Query("select c from ReceivedPaymentTotalInfo c where c.sReceivedPaymentsIdentifyNumber like %?1% or c.sReceivedPaymentsCustomerName like %?1% or c.sReceivedPaymentMemo like %?1% ")
	Page<ReceivedPaymentTotalInfo> getPage(String key, Pageable pageable);
	
	@Query("select c from ReceivedPaymentTotalInfo c")
	Page<ReceivedPaymentTotalInfo> getPage(Pageable pageable);
}
